package com.demo.personalaccountingbackend.common;

import lombok.Getter;

/**
 * 类描述信息
 *
 * @author zgx
 * @version 1.0
 * @date 2025/10/20 15:24
 */
@Getter
public enum  ResultCode  implements IResultCode {

    SUCCESS(200, "操作成功"),
    FAILED(500, "操作失败"),
    VALIDATE_FAILED(400, "参数检验失败"),
    UNAUTHORIZED(401, "暂未登录或token已经过期"),
    FORBIDDEN(403, "没有相关权限"),

    // 认证相关
    LOGIN_ERROR(1001, "用户名或密码错误"),
    ACCOUNT_DISABLED(1002, "账户已被禁用"),
    TOKEN_EXPIRED(1003, "token已过期"),
    TOKEN_INVALID(1004, "token无效"),
    REFRESH_TOKEN_EXPIRED(1005, "刷新token已过期"),
    REFRESH_TOKEN_INVALID(1006, "刷新token无效");

    private final Integer code;
    private final String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
